package org.dbwebx.flex.model.delegates {
	import org.dbwebx.flex.model.delegates.AbstractDelegate;

	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;

	/**
	 * @author Izzet_Mustafayev
	 */
	public class RemoteDelegate extends AbstractDelegate {
		/**
		 * Creates RemoteDelegate instance.
		 * @param responder
		 * @param method
		 * @param argArray
		 * @param destination
		 * @param useDefaultFault
		 */
		public function RemoteDelegate(responder : IResponder
                                        , method : String
                                        , argArray : Array
                                        , destination : String, useDefaultFault : Boolean = true) {
			super(destination, responder.result, responder.fault, true, useDefaultFault);
			executeCall(method, argArray);
		}		

		/**
		 * Retrives token.
		 */
		public function get token() : AsyncToken {
			return lastToken;
		}
	}
}
